package com.xuesaieducation.zshddemo;

import android.app.Activity;
import android.content.Context;
import android.os.Handler;

import com.gensee.entity.ChatMsg;
import com.gensee.entity.QAMsg;
import com.gensee.entity.VodObject;
import com.gensee.vod.VodSite;

import java.util.List;

/**
 * Created by yutf on 2018/1/12 0012.
 */

public abstract class GenseeVodCallback implements VodSite.OnVodListener
{
    private Activity mContext;
    private Handler mHandler;

    public GenseeVodCallback(Activity mContext)
    {
        this.mContext = mContext;
        mHandler = new Handler(mContext.getMainLooper());
    }

    @Override
    public void onChatHistory(String s, List<ChatMsg> list, int i, boolean b)
    {

    }

    @Override
    public void onQaHistory(String s, List<QAMsg> list, int i, boolean b)
    {

    }

    @Override
    public void onVodErr(int i)
    {
        mHandler.post(new Runnable()
        {
            @Override
            public void run()
            {
                onFailed();
            }
        });
    }

    public abstract void onSuccess(String vodId);

    public abstract void onFailed();

    @Override
    public void onVodObject(final String s)
    {
        mHandler.post(new Runnable()
        {
            @Override
            public void run()
            {
                onSuccess(s);
            }
        });
    }

    @Override
    public void onVodDetail(VodObject vodObject)
    {

    }
}
